package com.ikingtech.platform.service.application.service.generater;


import com.ikingtech.platform.service.application.service.ApplicationModelFieldService;
import com.ikingtech.platform.service.application.service.ApplicationModelRelationService;
import com.ikingtech.platform.service.application.service.ApplicationModelService;

/**
 * @author tie yan
 */
public class ApplicationPageCodeGenerator extends AbstractCodeGenerator {

    private final Boolean relateToApprove;

    private final String pageName;

    private final String initiateFormModelId;

    public ApplicationPageCodeGenerator(ApplicationModelService modelService,
                                        ApplicationModelFieldService fieldService,
                                        ApplicationModelRelationService modelRelationService,
                                        Boolean relateToApprove,
                                        String pageName,
                                        String initiateFormModelId) {
        super(modelService, fieldService, modelRelationService);
        this.relateToApprove = relateToApprove;
        this.pageName = pageName;
        this.initiateFormModelId = initiateFormModelId;
    }

    @Override
    protected Boolean relateToApprove() {
        return Boolean.TRUE.equals(this.relateToApprove);
    }

    @Override
    protected String initiateFormModelId() {
        return this.initiateFormModelId;
    }

    @Override
    protected String approveBusinessType() {
        return this.pageName;
    }
}
